import request from '@/utils/request'

// 查询生产计划订单详细
export function getWorkshopList() {
  return request({
    url: '/topmes/getWorkshopList/',
    method: 'get'
  })
}

// 查询产线列表
export function getLineList(workshopId) {
  return request({
    url: '/topmes/getLineList/' + workshopId,
    method: 'get'
  })
}
// 查询订单对应工序
export function getOrderSeqList(orderNumber) {
  return request({
    url: '/topmes/getOrderSeqList/' + orderNumber,
    method: 'get'
  })
}

// 查询生产计划订单列表
export function listTopOrder(query) {
  return request({
    url: '/order/topOrder/list',
    method: 'get',
    params: query
  })
}

// 查询生产计划订单详细
export function getTopOrder(orderId) {
  return request({
    url: '/order/topOrder/' + orderId,
    method: 'get'
  })
}

// 新增生产计划订单
export function addTopOrder(data) {
  return request({
    url: '/order/topOrder',
    method: 'post',
    data: data
  })
}

// 修改生产计划订单
export function updateTopOrder(data) {
  return request({
    url: '/order/topOrder',
    method: 'put',
    data: data
  })
}

// 删除生产计划订单
export function delTopOrder(orderId) {
  return request({
    url: '/order/topOrder/' + orderId,
    method: 'delete'
  })
}

// 生产订单
export function testingOrder(id) {
  return request({
    url: '/order/topOrder/testingOrder/' + id,
    method: 'get'
  })
}
// 生产订单
export function completeOrder(id) {
  return request({
    url: '/order/topOrder/completeOrder/' + id,
    method: 'get'
  })
}